<template>
  <div class="itembox">
    <div class="titlebox1">
      <span class="colorbox"></span>
      <span class="title" v-text="article.title"></span>
    </div>
    <div class="content">
      <div class="ar_img_box" v-html="article.background"></div>
      <div class="titlebox2">
        <span class="title" v-text="article.title"></span>
      </div>
      <div class="intro">
        <div class="introcontent" v-text="article.Intro"></div>
        <div class="other">
          <span class="time">
            <i class="el-icon-date"></i>
            时间：{{ article.date | chatDateFormate }}
          </span>
          <span class="category">
            <i class="el-icon-s-grid"></i>
            分类：{{ article.category[0] }}
          </span>
          <span class="view">
            <i class="el-icon-view"></i>
            浏览：{{ article.views }}
          </span>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
export default {
  data() {
    return {}
  },
  props: ["article"],
}
</script>
<style lang="scss" scoped>
@import "../../../scss/common.scss";
@media (min-width: 600px) {
  .itembox {
    height: 235px;
    background: white;
    padding: 10px 20px;
    text-align: left;
  }

  .titlebox1 {
    margin: 10px;
    text-align: left;
    margin-bottom: 20px;
    position: relative;
    .colorbox {
      position: absolute;
      left: -30px;
      top: -20px;
      display: inline-block;
      height: 45px;
      width: 10px;
      background: $ar_color;
    }
    .title {
      font-size: 25px;
      font-weight: bold;
    }
  }
  .titlebox2 {
    display: none;
  }
  .content {
    height: 170px;
    display: flex;
    .ar_img_box {
      display: inline-block;
      margin: 0px 10px;
      border: 1px solid rgb(231, 230, 229);
      box-sizing: border-box;
      background: white;
      height: 170px;
      width: 27%;
      overflow: hidden;
      vertical-align: middle;
    }

    .intro {
      text-align: left;
      width: 73%;
      .introcontent {
        font-size: 15px;
        line-height: 25px;
        color: rgb(119, 118, 116);
        margin: 0px 10px;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 5;
        overflow: hidden;
      }
    }
  }

  .other {
    margin: 0px 10px;
    margin-top: 12px;
    padding-top: 5px;
    border-top: 1px solid gainsboro;
    height: 35px;
    line-height: 35px;
    font-size: 14px;
    display: flex;
    span {
      margin-right: 20px;
      color: rgb(145, 152, 155);
    }
    // .category {
    //   color: #ba8f6c;
    // }
    // .time {
    //   color: #725334;
    // }
    // .view {
    //   color: rgb(69, 137, 148);
    // }
  }
}

@media (max-width: 600px) {
  .itembox {
    width: 100%;
    height: 21rem;
    background: white;
    text-align: left;
  }

  .titlebox1 {
    display: none;
  }
  .titlebox2 {
    display: block;
    margin: 0.5rem 0rem;
    .title {
      display: -webkit-box;
      -webkit-box-orient: vertical;
      -webkit-line-clamp: 1;
      overflow: hidden;
      font-size: 1rem;
      line-height: 1.875rem;
      margin: 0rem 1rem;
      font-weight: bold;
    }
  }

  .content {
    .ar_img_box {
      display: inline-block;
      height: 10rem;
      width: 100%;
      vertical-align: middle;
      padding: 1rem 1rem 0rem 1rem;
      box-sizing: border-box;
    }

    .intro {
      text-align: left;
      width: 100%;
      .introcontent {
        font-size: 0.83rem;
        line-height: 1.2rem;
        color: rgb(119, 118, 116);
        margin: 0rem 1rem;
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 3;
        overflow: hidden;
      }
    }
  }

  .other {
    margin: 0rem 1rem;
    margin-top: 12px;
    padding-top: 5px;
    border-top: 1px solid gainsboro;
    line-height: 1.4rem;
    font-size: 0.82rem;
    span {
      margin-right: 20px;
      color: rgb(145, 152, 155);
    }
    .time {
      display: block;
    }
    .category {
      display: inline-block;
    }
    .view {
      display: inline-block;
      float: right;
      margin-right: 0.1rem;
    }
  }
}
</style>
<style lang="scss">
@media (min-width: 600px) {
  .ar_img_box {
    img {
      display: inline-block;
      width: 100%;
      height: 170px;
      object-fit: cover;
    }
  }
}
@media (max-width: 600px) {
  .ar_img_box {
    img {
      display: inline-block;
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }
}
</style>
